/**
  ******************************************************************************
  * @file    app_COMM.h
  * @author  Feirui_Joe
  * @version V0.1
  * @date    07/26/2010
  * @brief   Outputs Driver
  ******************************************************************************
  * @copy
  *
  * <h2><center>&copy; COPYRIGHT 2010 Feirui</center></h2>
  */ 



/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef  __APP_COMM_H__
#define  __APP_COMM_H__


#ifdef __cplusplus
 extern "C" {
#endif


/**
  * @brief  INCLUDE FILES.
  */


/**
  * @brief GLOBALS RAM definition
  */
#ifdef   APP_GLOBALS_COMM
#define  APP_EXT_COMM
#else
#define  APP_EXT_COMM  extern
#endif


#define EnableUSBDetectionOpt
#define EnableCommPSWLimitOpt
#define EnableWRRangeLimitOpt

/* StateUpdIn OS_Flags config bits */
#define OSCOMMFlags_USBRXEnd                       ((OS_FLAGS)DEF_BIT_00)
#define OSCOMMFlags_RS232RXEnd                     ((OS_FLAGS)DEF_BIT_01)
#define OSCOMMFlags_RS485RXEnd                     ((OS_FLAGS)DEF_BIT_02)
#define OSCOMMFlags_UpdTiming                      ((OS_FLAGS)DEF_BIT_03)
#define OSCOMMFlags_Reserve04                      ((OS_FLAGS)DEF_BIT_04)
#define OSCOMMFlags_Reserve05                      ((OS_FLAGS)DEF_BIT_05)
#define OSCOMMFlags_Reserve06                      ((OS_FLAGS)DEF_BIT_06)
#define OSCOMMFlags_Reserve07                      ((OS_FLAGS)DEF_BIT_07)
#define OSCOMMFlags_Reserve08                      ((OS_FLAGS)DEF_BIT_08)
#define OSCOMMFlags_Reserve09                      ((OS_FLAGS)DEF_BIT_09)
#define OSCOMMFlags_Reserve10                      ((OS_FLAGS)DEF_BIT_10)
#define OSCOMMFlags_Reserve11                      ((OS_FLAGS)DEF_BIT_11)
#define OSCOMMFlags_Reserve12                      ((OS_FLAGS)DEF_BIT_12)
#define OSCOMMFlags_Reserve13                      ((OS_FLAGS)DEF_BIT_13)
#define OSCOMMFlags_Reserve14                      ((OS_FLAGS)DEF_BIT_14)
#define OSCOMMFlags_Reserve15                      ((OS_FLAGS)DEF_BIT_15)

#define OSCOMMFlags_ALL                            (OSCOMMFlags_USBRXEnd   |\
                                                    OSCOMMFlags_RS232RXEnd |\
                                                    OSCOMMFlags_RS485RXEnd |\
                                                    OSCOMMFlags_UpdTiming  )
                                                    
#define OSCOMMFlags_DefaultValue                   ((OS_FLAGS)    0x0000)


#define CommuniTimingFreq                          10     /* 10HZ  */

APP_EXT_COMM uint8_t ResetHardwareTimeDelay;



APP_EXT_COMM void PORGlobalRAMReset_COMM(void);
APP_EXT_COMM uint8_t DatabasePasswordHandling(void);


#ifdef __cplusplus
}
#endif


#endif   /*  __APP_COMM_H__  */

/******************* (C) COPYRIGHT 2010 Feirui *****END OF FILE****/